import { defineStore } from "pinia";

export default defineStore("useInfoStore", {
  state() {
    return {
      info: {
        name: '',
        birth: '',
        gender: 1,
        phone: ''
      },
      userId: null
    };
  },
  actions: {
    setUserInfo(info) {
      this.info = info;
    },
    setInfoBirth(birth) {
      this.info.birth = birth
    },
    setUserId(userId) {
      this.userId = userId;
    },
  },
  persist: {
    enabled: true,
    strategies: [
      {
        storage: sessionStorage,
      },
    ],
  },
});
